<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
	<title>康人签到系统管理端</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

<!-- 新模板 -->
<link rel="shortcut icon" href="<c:url value='/template/new_muban/images/favicon.ico'/>" type="image/x-icon"/>

<!-- 最新导入 -->
<script type="text/javascript" src="<c:url value='/template/new_muban/js/jquery-min-1.7.js'/>"></script>
<link rel="stylesheet" href="<c:url value='/template/new_muban/css/font.css'/>">
<link rel="stylesheet" href="<c:url value='/template/new_muban/css/xadmin.css'/>">   
<script src="<c:url value='/template/new_muban/lib/layui/layui.js'/>" charset="utf-8"></script> 
<script type="text/javascript" src="<c:url value='/template/new_muban/js/xadmin.js'/>"></script>

<link rel="stylesheet" href="<c:url value='/template/new_muban/css/login.css'/>">





</head>
<body class="login-bg">
 	<div class="login layui-anim layui-anim-up">
        <div class="message"><%-- <img src="<c:url value='/template/new_muban/images/tubiao.jpg'/>"> --%>康人签到系统管理端</div>
        <div id="darkbannerwrap"></div>
        <!-- required：注册浏览器所规定的必填字段 
lay-verify：注册form模块需要验证的类型 
class="layui-input"：layui.css提供的通用CSS类  -->
        <form action="<c:url value='/toIndex.do'/>" onsubmit="return login_vefily();" method="post" class="layui-form" >
            <input name="username" id="root_name" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" id="root_pwd" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20" >
        </form>
    </div>
</div>

    
    <script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
    <script type="text/javascript">
    console.log(returnCitySN["cip"]+','+returnCitySN["cname"])
    
    var ip = returnCitySN["cip"];
    var address = returnCitySN["cname"];
    
    </script>
    <script>
    
    
     	function login_vefily() {
     		var username = $("#root_name").val();
     		var password = $("#root_pwd").val();
     		if(username == null || password == null){
     			layer.msg('必填项不能为空!',{icon: 5,time:3000},function(){
                    
                });
     		}
     		var aa = 0;
     		
     		if(ip == null || ip == ""){
     			ip = "未获取";
     			address = "未获取";
     		}
  
     		
     		 $.ajax({
                 type: "POST",
                 async : false, // 注意此处需要yi步  
                 url:  "<c:url value='/loginVerify.do'/>",
                 data: {"username":username,"password":password,"ip":ip,"address":address},
                 success: function(data){
                	 console.log("data : "+data);
                    
                         if (data == 0) {
                             aa = 0;
                         
                         	 	layer.msg('账号或密码错误!',{icon: 5,time:3000},function(){
     		                     
     		                   });
     	                	
                          } else if(data == 1) {
                         	aa=1;
     	                	layer.msg("验证成功,正在跳转...");
     	                	
     		           } else if(data == -1) {
     		        	   aa = 0;
                      
                       	 	layer.msg('该账号未审核!',{icon: 5,time:3000},function(){
     		                     
     		                   });
     	          		} 
     		          
                     
                 }
	        }); 
     		if(aa == 0){
     			 return false;
     		}
		}
        
    </script>

    
 
   
</body>
</html>